/** \file
 *	\brief cl_device_id wrapper.
 */
#ifndef OCL_DEVICE_INCLUDED
#define OCL_DEVICE_INCLUDED 1

#include "../ocl/types.h"

/** \brief cl_device_id plus infos */
typedef struct 
{
	cl_device_id   id;                        /*!< a copy of the device id            */
	cl_device_type TYPE;                      /*!< CL_DEVICE_TYPE                     */
	cl_uint        MAX_COMPUTE_UNITS;         /*!< CL_DEVICE_MAX_COMPUTE_UNITS        */
	size_t         MAX_WORK_ITEM_SIZES[3];    /*!< CL_DEVICE_MAX_WORK_ITEM_SIZES      */
	size_t         MAX_WORK_GROUP_SIZE;       /*!< CL_DEVICE_MAX_WORK_GROUP_SIZE      */
	cl_uint        MAX_CLOCK_FREQUENCY;       /*!< CL_DEVICE_MAX_CLOCK_FREQUENCY      */
	cl_ulong       MAX_CONSTANT_BUFFER_SIZE;  /*!< CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE */
	cl_ulong       MAX_MEM_ALLOC_SIZE;        /*!< CL_DEVICE_MAX_MEM_ALLOC_SIZE       */
	cl_ulong       GLOBAL_MEM_SIZE;           /*!< CL_DEVICE_GLOBAL_MEM_SIZE          */
	cl_ulong       LOCAL_MEM_SIZE;            /*!< CL_DEVICE_LOCAL_MEM_SIZE           */
	cl_platform_id PLATFORM;                  /*!< CL_DEVICE_PLATFORM                 */
	char *         NAME;                      /*!< CL_DEVICE_NAME                     */
	char *         VENDOR;                    /*!< CL_DEVICE_VENDOR                   */
	char *         DRIVER_VERSION;            /*!< CL_DRIVER_VERSION                  */
	char *         OPENCL_VERSION;            /*!< CL_DEVICE_VERSION                  */
} ocl_device;

int     ocl_device_load( cl_device_id id, ocl_device *device );
void    ocl_device_quit( ocl_device *device );

cl_bool ocl_device_available(   const ocl_device *device );
cl_bool ocl_device_can_compile( const ocl_device *device );

size_t  ocl_device_max_alloc_real4( const ocl_device *device );
size_t  ocl_device_max_local_real4( const ocl_device *device );


#endif
